<?php    
    //$css = JURI::base().'modules/mod_jv_accordion_ajax/assets/css/'.$params->get('jv_style').'.css';
	$css = $params->get('jv_style').'.css';
	$document =& JFactory::getDocument();
	$js = JURI::base().'modules/mod_jv_accordion_ajax/assets/js/list_litefaqs.js';
	$isMultiItem = $params->get('multi_item');
	$isAllItem = $params->get('all_item_startup');
	$isLoadAjax = $params->get('load_ajax');
	$urlAjax = JURI::base().'modules/mod_jv_accordion_ajax/ajax.php';
	$isLoadFirstArticle = $params->get('load_first_article','');
	$jvStyle = $params->get('jv_style');
	// Adding Css to Header
	JHTML::_('stylesheet',$css,'modules/mod_jv_accordion_ajax/assets/css/');
?>
	<script type="text/javascript">
window.addEvent('domready', function() {
	var accordion<?php echo $module->id; ?> = new JVAccordion('a.atStart<?php echo $module->id; ?>', 'div.atStart<?php echo $module->id; ?>', {
		display: false,
		opacity: true,
		alwaysHide: true,
		urlAjax:'<?php echo $urlAjax; ?>',
		moduleId:'<?php echo $module->id; ?>',
		isMultiItem:<?php echo $isMultiItem; ?>,
		isAllItem:<?php echo $isAllItem; ?>,
		jvStyle:'<?php echo $jvStyle; ?>',
		isLoadAjax:<?php echo $params->get('load_ajax'); ?>,
		isLoadFirstArticle:<?php echo $isLoadFirstArticle; ?>,
		onActive: function(toggler, element) {
			toggler.removeClass('toggler');
			toggler.addClass('toggler-active');
		},	 
		onBackground: function(toggler, element){
			toggler.removeClass('toggler-active');
			toggler.addClass('toggler');
		}		
	}, $('jv_accordion<?php echo $module->id; ?>'));	
});
</script>
<div id="jv_accordion<?php echo $module->id; ?>" class="<?php echo $params->get('jv_style'); ?>">
	<?php
	   $i = 0;
	   if(count($list)>0){	   
		foreach ($list as $item){
		      if(($i == 0 && $isLoadFirstArticle == 1)&& ($isAllItem !=1)){
		        echo '<div class="jv_accordion" onclick="return false;">'.modJvAccordion::renderArticle($item,$module->id, $params,$access,$isLoadFirstArticle).'</div>'; 
		      }	else  {	          		    
			    echo '<div class="jv_accordion" onclick="return false;">'.modJvAccordion::renderArticle($item,$module->id, $params,$access).'</div>';	
		      }
		   $i++;   		          
		}
	   }
	?>
</div>
<?php $document->addScript($js); ?>

